package com.snopy.designPattern.observer.impl;

import com.snopy.designPattern.observer.EventListener;
import lombok.extern.slf4j.Slf4j;

import java.io.File;

/**
 * @author snopy
 * @version 1.0.0
 * @classname EmailNotificationListener
 * @description
 * @email 77912204@qq.com
 * @date 2022/03/16 16:31
 */
@Slf4j
public class EmailNotificationListener implements EventListener {
    private String email;

    public EmailNotificationListener(String email) {
        this.email = email;
    }

    @Override
    public void update(String eventType, File file) {
        log.info("Email to {} : Someone has performed {} operation with the following file: {}",email,eventType,file.getName());
    }
}
